#include <list>
#include <string>

#include "base_element.h"
#include "attribute.h"

using namespace std;

const string BaseElement::REGEX_NAME = "";//"[A-Za-z_][A-Za-z_0-9.-]*";

BaseElement::BaseElement (string aName) : name (aName) {
}

BaseElement::~BaseElement () {
}

void BaseElement::setAttList (list<Attribute*> aList) {
	attList = aList;
}

void BaseElement::printAttributes(std::ostream& out) {
	if (attList.empty()) {
		return;
	}
	
	out << "<!ATTLIST " << name << "\n";
	for (list<Attribute*>::iterator iter = attList.begin();
	     iter != attList.end();
	     ++iter) {
	
		(*iter)->print(out);
	}
	out << ">\n";
}
